﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Csla.Xaml;
using Converter;
using System.Resources;
using System.Reflection;
using csla4Skeleton.UI.SL.Reports;
using csla4Skeleton.UI.SL.Reports.BanHang;
using csla4Skeleton.UI.SL.Reports.Kho;
using csla4Skeleton.UI.SL.Reports.MuaHang;
using csla4Skeleton.UI.SL.Reports.NganHang;
using csla4Skeleton.UI.SL.Reports.TienMat;

namespace csla4Skeleton.UI.SL
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            LocalizationConverter converter = new LocalizationConverter();
            converter.LocalResourceManager = new ResourceManager("csla4Skeleton.UI.SL.DanhMuc.DM_BenKetChuyen.Resources", Assembly.GetExecutingAssembly());
            this.Resources.Add("Localization", converter);
            InitializeComponent();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            Navigator.Current.ContentPlaceholder = this.PlaceHolder;
            Navigator.Current.ProcessInitialNavigation();
            Navigator.Current.Navigate("csla4Skeleton.UI.SL.StartView,csla4Skeleton.UI.SL");
            Navigator.Current.AfterNavigation += new EventHandler(PlaceHolder_AfterNavigation);
            Dispatcher.BeginInvoke(delegate { this.PlaceHolder.Focus(); });
        }

        private void PlaceHolder_AfterNavigation(object sender, EventArgs e) 
        {
            this.scrollViewer.ScrollToTop();
        }

        private void BalanceAccount_Click(object sender, RoutedEventArgs e)
        {
            ReportDate reportDate = new ReportDate(ReportType.BalanceAccountingReport);
            reportDate.Show();
        }

        private void BalanceGeneration_Click(object sender, RoutedEventArgs e)
        {
            ReportDate reportDate = new ReportDate(ReportType.BalanceGenerationReport);
            reportDate.Show();
        }

        private void BalanceDetailGeneration_Click(object sender, RoutedEventArgs e)
        {
            ReportDate reportDate = new ReportDate(ReportType.BalanceDetailGenerationReport);
            reportDate.Show();
        }

        private void BusinessResult_Click(object sender, RoutedEventArgs e)
        {
            ReportDate reportDate = new ReportDate(ReportType.BusinessResultReport);
            reportDate.Show();
        }

        private void CashFlow_Click(object sender, RoutedEventArgs e)
        {
            ReportDate reportDate = new ReportDate(ReportType.CashFlowReport);
            reportDate.Show();
        }

        private void BangKeHoaDonBanHang_Click(object sender, RoutedEventArgs e)
        {
            FormThongTin formThongTin = new FormThongTin(ReportType.Sales_InvoiceBookReport);
            formThongTin.Show();
        }

        private void BangKeHoaDonCuaMotMatHang_Click(object sender, RoutedEventArgs e)
        {
            ReportDateInventory reportDateInventory = new ReportDateInventory(ReportType.Sales_SalesBook_OneInventoryReport);
            reportDateInventory.Show();
        }

        private void SoKho_Click(object sender, RoutedEventArgs e)
        {
            StoreBookReport storeBookReport = new StoreBookReport();
            storeBookReport.Show();
        }

        private void HoaDonMuaHang_Click(object sender, RoutedEventArgs e)
        {
            FormThongTin formThongTin = new FormThongTin(ReportType.Buy_InvoiceBookReport);
            formThongTin.Show();
        }

        private void SoQuyTienMat_Click(object sender, RoutedEventArgs e)
        {
            FormThongTin formThongTin = new FormThongTin(ReportType.Cash_FundBookReport);
            formThongTin.Show();
        }

        private void SoQuyTienMatChiTiet_Click(object sender, RoutedEventArgs e)
        {
            FormThongTin formThongTin = new FormThongTin(ReportType.Cash_FundBookDetailReport);
            formThongTin.Show();
        }

        private void SoTienGuiNganHang_Click(object sender, RoutedEventArgs e)
        {
            FormThongTin formThongTin = new FormThongTin(ReportType.Bank_FundBookDetailReport);
            formThongTin.Show();
        }
    }
}
